<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3-escook</title>
  <link rel="stylesheet" href="./lib/style.css">
  <script type="importmap">
    {
      "imports" : {
        "vue": "./lib/vue-3.4.29.js"
      }
    }
  </script>
  <script type="module">
    import { createApp, ref } from 'vue'

    const app = createApp({
      setup() {
        const imgURL = ref('./image/1.jpg')
        const width = ref(200)

        const attrObj = {
          title: '这是一个文本框',
          id: 'ipt',
          value: 'abc',
          placeholder: '请输入账号'
        }

        return {
          imgURL,
          width,
          attrObj
        }
      }
    })

    app.mount('#app')
  </script>
</head>

<body>
  <div id="app">
    <!-- v-bind:属性="动态的变量值" -->
    <!-- :属性="动态的变量值" -->
    <img :src="imgURL" alt="" :width>
    <hr>
    <button @click="imgURL = './image/2.jpg'">change Image</button>
    <button @click="width += 10">width + 10</button>

    <hr>
    <input type="text" v-bind="attrObj">
  </div>
</body>

</html>